<template>
  <div v-loading="loading" element-loading-text="模型生成中...">
    <div style="width: 100%; border: 1px solid white;">
      <el-form  ref="form" label-width="100px">

        <el-form-item label="直径">
          <el-input size="small" v-model.number="d" type="number" placeholder="请输入内容"></el-input>
        </el-form-item>
        <el-form-item label="机身长度">
          <el-input size="small" v-model.number="l" type="number" placeholder="请输入内容"></el-input>
        </el-form-item>
        <el-form-item label="隔框间距">
          <el-input size="small" v-model.number="d1" type="number" placeholder="请输入内容"></el-input>
        </el-form-item>
        <el-form-item label="桁条个数">
          <el-input size="small" v-model.number="n" type="number" placeholder="请输入内容"></el-input>
        </el-form-item>
        <el-form-item label="地板夹角">
          <el-input size="small" style="width: 46%" v-model.number="a" type="number" placeholder="请输入内容"></el-input>
          <el-input size="small"  style="width: 46%; margin-left: 4%"  v-model.number="a1" type="number" placeholder="请输入内容"></el-input>
        </el-form-item>
        <el-form-item label="支柱夹角">
          <el-input size="small" v-model.number="b" type="number" placeholder="请输入内容"></el-input>
        </el-form-item>
        <el-form-item label="下壁板夹角">
          <el-input size="small" style="width: 46%" v-model.number="c" type="number" placeholder="请输入内容"></el-input>
          <el-input size="small"  style="width: 46%; margin-left: 4%"  v-model.number="c1" type="number" placeholder="请输入内容"></el-input>
        </el-form-item>
        <el-form-item label="下壁支柱夹角">
          <el-input size="small" v-model.number="e" type="number" placeholder="请输入内容"></el-input>
        </el-form-item>
      </el-form>
      <div>
<!--        <img src="/image/spline.png" height="135" width="280"/>-->
        <div style="margin-top: 10px;text-align: center;">
          <el-button type="primary" size="small" @click="creatFuselageSkeleton">创建</el-button>
          <el-button size="small"  @click="closeDialog">取消</el-button>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
  import {
    Axis,
    CrownCADPlugin,
    Direction, PluginCADToolFunctionType,
    PluginFunctionType,
    Point
  } from "../../../../nodeApp/static/lib/crowncad-plugin-sdk-0.0.1";
  export default {
    name: "FuselageSkeleton",
    data() {
      return {
        loading:false,
        d:50,
        l:400,
        d1:20,
        n:20,
        a:6,
        a1:10,
        b:45,
        c:50,
        c1:55,
        e: 80,
        plane: null,
        minHeight: 375,
        axis: null,
        dir: null
      }
    },
    async mounted() {
      //创建插件对象
      this.crownCADPlugin = new CrownCADPlugin();
      //设置CrownCAD平台地址
      this.crownCADPlugin.setParentOrigin(window.url);
      //.设置与CrownCAD平台尝试建立连接的次数
      this.crownCADPlugin.setMaxAttempt(5);
      //设置插件在CrownCAD平台显示的尺寸
      this.crownCADPlugin.setLayout(320, 320, this.minHeight);
      //.发送与CrownCAD平台建立连接的请求
      // 发送与CrownCAD平台建立连接的请求
      await this.crownCADPlugin.connect()
      await this.crownCADPlugin.request.execFunction(PluginFunctionType.LAYOUT, { minWidth: 320, width: 320, maxHeight: this.minHeight})

      // 选择元素监听函数
      this.crownCADPlugin.command.clearCommand();
    },
    methods: {
      //关闭对话框
      closeDialog() {
        this.crownCADPlugin.request.execFunction(PluginCADToolFunctionType.CLOSEACTIVECMD, null);
      },
      async creatFuselageSkeleton() {

        await this.createFuselageExtrude()

        await this.createFuselageRevolveSurface()

        await this.createFuselagePartitionFrame()

        await this.createFuselageStringer()

        await this.createFuselagePillar()

        await this.createFuselagePillar1()

      },
      async createFuselageExtrude() {
        this.crownCADPlugin.command.sketch.createSketch({sketchName: '草图1', datumId: 8});

        this.crownCADPlugin.command.sketch.createCircle({
          centerPoint: new Point(0,0,0),
          circlePoint: new Point(0,0.5* this.d,0),
        })
        //退出草图
        this.crownCADPlugin.command.sketch.exitSketch();
        //实现草图操作，参数true会覆盖之前的草图，不传则不会
        await this.crownCADPlugin.command.execute(true)

        this.crownCADPlugin.command.clearCommand();

        let res = await this.crownCADPlugin.query.getEntitiesByFeatureNames(["草图1"]);

        // this.crownCADPlugin.command.solid.extrude({
        //   sketch: res.data.entities[0].id,
        //   height1: this.l,
        // }, "拉伸凸台");


        this.crownCADPlugin.command.surface.extrudeSurface({
          curveIds: [res.data.entities[0].id],
          extrudeType1: 0,
          height1: this.l,
          // toSurface1: this.faceIds[1].id,
          draftType1: -1,
          reverse: 1
          // extrudeType2: 1,
          // height2: 10,
          // toSurface2: this.faceIds[0].id,
          // draftType2: -1,
        },'拉伸曲面1')
        await this.crownCADPlugin.command.execute()
        this.crownCADPlugin.command.clearCommand();
      },

      async createFuselageRevolveSurface() {
        this.crownCADPlugin.command.sketch.createSketch({sketchName: '草图2', datumId: 36});
        this.crownCADPlugin.command.sketch.createSketchLine({
          startPoint:  new Point(0.5*this.d*-1, 2, 0),
          endPoint: new Point(0.5*this.d*-1, this.d/27 + 2, 0)
        })
        this.crownCADPlugin.command.sketch.createSketchLine({
          startPoint:  new Point(0.5*this.d*-1, 2+ this.d/54, 0),
          endPoint: new Point(0.5*this.d*-1+ this.d/27, 2+ this.d/54, 0)
        })



        //退出草图
        this.crownCADPlugin.command.sketch.exitSketch();
        //实现草图操作，参数true会覆盖之前的草图，不传则不会
        await this.crownCADPlugin.command.execute()

        this.crownCADPlugin.command.clearCommand();
        let res = await this.crownCADPlugin.query.getElementsByFeatureNames(["草图2"]);

        let tempLine= []
        res.data.elements.forEach(element => {
          // 找到根据类型19找到所有的面，并储存到面faceIds数组，前两个面即为机翼的上面和下面
          if(element.params.type=== 10) {
            tempLine.push(element)
          }
        })
        let basePnt = new Point(0, 0, 0);
        let endPnt = new Point(0, 0, 10);
        this.axis = new Axis();
        this.axis.setPoint(basePnt, endPnt);
        this.crownCADPlugin.command.surface.revolveSurface({
          contours: [tempLine[0].id],
          axis: this.axis,
          revolveType1: 0,
          angle1: 360,
        }, '旋转曲面1')

        await this.crownCADPlugin.command.execute()
        this.crownCADPlugin.command.clearCommand();

        this.crownCADPlugin.command.surface.revolveSurface({
          contours: [tempLine[1].id],
          axis: this.axis,
          revolveType1: 0,
          angle1: 360,
        }, '旋转曲面2')
        await this.crownCADPlugin.command.execute()
        this.crownCADPlugin.command.clearCommand();

      },

      async createFuselagePartitionFrame() {
        let res1 = await this.crownCADPlugin.query.getEntitiesByFeatureNames(["旋转曲面1"]);

        let res2 = await this.crownCADPlugin.query.getEntitiesByFeatureNames(["旋转曲面2"]);
        let point1 = new Point(0,0,0);
        let point2 = new Point(0,0,-100);
        this.dir = new Direction();
        this.dir.setPoint(point1, point2);

        this.crownCADPlugin.command.solid.linearPattern({
          baseType: 0,
          body: res1.data.entities[0]?.id,
          spacing1: this.d1,
          instanceNum1: parseInt((this.l-2)/ this.d1) +1,
          direction1: this.dir,
          reverse1: 0}, "线性阵列1")
        await this.crownCADPlugin.command.execute()

        this.crownCADPlugin.command.clearCommand();
        this.crownCADPlugin.command.solid.linearPattern({
          baseType: 0,
          body: res2.data.entities[0]?.id,
          spacing1: this.d1,
          instanceNum1: parseInt((this.l-2)/ this.d1) +1,
          direction1: this.dir,
          reverse1: 0}, "线性阵列2")


        await this.crownCADPlugin.command.execute()

        this.crownCADPlugin.command.clearCommand();

      },

      async createFuselageStringer() {
        this.crownCADPlugin.command.sketch.createSketch({sketchName: '草图3', datumId: 8});
        this.crownCADPlugin.command.sketch.createSketchLine({
          startPoint:  new Point(0, 0.5*this.d- this.d/27*2/3, 0),
          endPoint: new Point(0, this.d*0.5, 0)
        })
        this.crownCADPlugin.command.sketch.createSketchLine({
          startPoint:  new Point(0, 0.5*this.d- this.d/27*2/3, 0),
          endPoint: new Point(this.d/27*2/3, this.d*0.5 - this.d/27*2/3, 0)
        })
        //退出草图
        this.crownCADPlugin.command.sketch.exitSketch();
        //实现草图操作，参数true会覆盖之前的草图，不传则不会
        await this.crownCADPlugin.command.execute()

        this.crownCADPlugin.command.clearCommand();

        let res = await this.crownCADPlugin.query.getEntitiesByFeatureNames(["草图3"]);


        this.crownCADPlugin.command.surface.extrudeSurface({
          curveIds: [res.data.entities[0].id],
          extrudeType1: 0,
          height1: this.l,
          draftType1: -1,
          reverse: 1
        },'拉伸曲面2')
        await this.crownCADPlugin.command.execute()
        this.crownCADPlugin.command.clearCommand();
        let res1 = await this.crownCADPlugin.query.getEntitiesByFeatureNames(["拉伸曲面2"]);


        this.crownCADPlugin.command.solid.circularPattern({
          baseType: 0,
          body:res1.data.entities[0]?.id,
          axis:  this.axis,
          angle1: 360,
          instanceNum1: this.n,
          equalSpacing1: 1
        }, "圆周阵列");

        await this.crownCADPlugin.command.execute()
        this.crownCADPlugin.command.clearCommand();
      },

      async createFuselagePillar() {
        let res = await this.crownCADPlugin.query.getElementsByFeatureNames(["旋转曲面2"]);

        let plane= null
        res.data.elements.forEach(element => {
          // 找到根据类型19找到所有的面，并储存到面faceIds数组，前两个面即为机翼的上面和下面
          if(element.type=== 19) {
            this.plane= element
          }
        })

        this.crownCADPlugin.command.clearCommand();

        this.crownCADPlugin.command.sketch.createSketch({sketchName: '草图4', datumId: this.plane.id});
        let r= 0.5*this.d- this.d/27
        let angle1 = (this.a / 180) * Math.PI;
        let angle2 = (this.a1 / 180) * Math.PI;
        this.crownCADPlugin.command.sketch.createArcByCenter({
          centerPoint: new Point(0,0,0),
          startPoint: new Point(r* Math.cos(angle2), -1* r* Math.sin(angle2), 0),
          endPoint: new Point(r* Math.cos(angle1), -1* r* Math.sin(angle1), 0),
        })
        this.crownCADPlugin.command.sketch.createArcByCenter({
          centerPoint: new Point(0,0,0),
          startPoint: new Point(-1* r* Math.cos(angle1), -1* r* Math.sin(angle1), 0),
          endPoint: new Point(-1* r* Math.cos(angle2), -1* r* Math.sin(angle2), 0),
        })
        this.crownCADPlugin.command.sketch.createSketchLine({
          startPoint:  new Point(r* Math.cos(angle1), -1* r* Math.sin(angle1), 0),
          endPoint: new Point(-1* r* Math.cos(angle1), -1* r* Math.sin(angle1), 0)
        })

        this.crownCADPlugin.command.sketch.createSketchLine({
          startPoint:  new Point(r* Math.cos(angle2), -1* r* Math.sin(angle2), 0),
          endPoint: new Point(-1* r* Math.cos(angle2), -1* r* Math.sin(angle2), 0)
        })

        //退出草图
        this.crownCADPlugin.command.sketch.exitSketch();
        //实现草图操作，参数true会覆盖之前的草图，不传则不会
        await this.crownCADPlugin.command.execute()

        this.crownCADPlugin.command.clearCommand();

        this.crownCADPlugin.command.sketch.createSketch({sketchName: '草图5', datumId: this.plane.id});
        this.crownCADPlugin.command.sketch.createSketchLine({
          startPoint:  new Point(r* Math.cos(angle1), -1* r* Math.sin(angle1), 0),
          endPoint: new Point(-1* r* Math.cos(angle1), -1* r* Math.sin(angle1), 0)
        })

        //退出草图
        this.crownCADPlugin.command.sketch.exitSketch();
        //实现草图操作，参数true会覆盖之前的草图，不传则不会
        await this.crownCADPlugin.command.execute()

        this.crownCADPlugin.command.clearCommand();

        let res1 = await this.crownCADPlugin.query.getEntitiesByFeatureNames(["草图4"]);

        this.crownCADPlugin.command.surface.fillSurface({
          boundaryCurveIds: [ res1.data.entities[0]?.id]
        },'平面区域')

        await this.crownCADPlugin.command.execute();

        this.crownCADPlugin.command.clearCommand();
        let res2 = await this.crownCADPlugin.query.getEntitiesByFeatureNames(["平面区域"]);

        this.crownCADPlugin.command.solid.linearPattern({
          baseType: 0,
          body: res2.data.entities[0]?.id,
          spacing1: this.d1,
          instanceNum1: parseInt((this.l-2)/ this.d1) +1,
          direction1: this.dir,
          reverse1: 0}, "线性阵列3")
        await this.crownCADPlugin.command.execute();
        this.crownCADPlugin.command.clearCommand();
        let res3 = await this.crownCADPlugin.query.getElementsByFeatureNames(["线性阵列3"]);


        let planes= []
        res3.data.elements.forEach(element => {
          // 找到根据类型19找到所有的面，并储存到面faceIds数组，前两个面即为机翼的上面和下面
          if(element.type=== 19) {
            planes.push(element)
          }
        })

        let res4 = await this.crownCADPlugin.query.getEntitiesByFeatureNames(["草图5"]);

        this.crownCADPlugin.command.surface.extrudeSurface({
          curveIds: [res4.data.entities[0].id],
          extrudeType1: 1,
          // height1: this.l,
          toSurface1: planes[planes.length-1].id,
          draftType1: -1,
          reverse: 1
          // extrudeType2: 1,
          // height2: 10,
          // toSurface2: this.faceIds[0].id,
          // draftType2: -1,
        },'拉伸曲面10')
        await this.crownCADPlugin.command.execute();
        this.crownCADPlugin.command.clearCommand();

        let angle3 = (this.b / 180) * Math.PI;
        this.crownCADPlugin.command.sketch.createSketch({sketchName: '草图6', datumId: this.plane.id});
        this.crownCADPlugin.command.sketch.createSketchLine({
          startPoint:  new Point(r* Math.cos(angle3), -1* r* Math.sin(angle3), 0),
          endPoint: new Point(r* Math.cos(angle3),  r* Math.sin(angle2)*-1, 0)
        })

        //退出草图
        this.crownCADPlugin.command.sketch.exitSketch();
        //实现草图操作，参数true会覆盖之前的草图，不传则不会
        await this.crownCADPlugin.command.execute()

        this.crownCADPlugin.command.clearCommand();

        this.crownCADPlugin.command.sketch.createSketch({sketchName: '草图7', datumId: this.plane.id});


        this.crownCADPlugin.command.sketch.createSketchLine({
          startPoint:  new Point(r* Math.cos(angle3)*-1, -1* r* Math.sin(angle3), 0),
          endPoint: new Point(r* Math.cos(angle3)*-1,  r* Math.sin(angle2)*-1, 0)
        })

        //退出草图
        this.crownCADPlugin.command.sketch.exitSketch();
        //实现草图操作，参数true会覆盖之前的草图，不传则不会
        await this.crownCADPlugin.command.execute()

        this.crownCADPlugin.command.clearCommand();

        let res6 = await this.crownCADPlugin.query.getEntitiesByFeatureNames(["草图6"]);


        this.crownCADPlugin.command.surface.extrudeSurface({
          curveIds: [res6.data.entities[0].id],
          extrudeType1: 0,
          height1: 0.5,
          draftType1: -1,
          // reverse: 1,
          extrudeType2: 0,
          height2: 0.5,
          draftType2: -1,
        },'拉伸曲面11')
        await this.crownCADPlugin.command.execute()

        this.crownCADPlugin.command.clearCommand();
        let res7 = await this.crownCADPlugin.query.getEntitiesByFeatureNames(["草图7"]);


        this.crownCADPlugin.command.surface.extrudeSurface({
          curveIds: [res7.data.entities[0].id],
          extrudeType1: 0,
          height1: 0.5,
          draftType1: -1,
          // reverse: 1,
          extrudeType2: 0,
          height2: 0.5,
          draftType2: -1,
        },'拉伸曲面12')
        await this.crownCADPlugin.command.execute()

        this.crownCADPlugin.command.clearCommand();
        let res8 = await this.crownCADPlugin.query.getEntitiesByFeatureNames(["拉伸曲面11"]);

        this.crownCADPlugin.command.solid.linearPattern({
          baseType: 0,
          body: res8.data.entities[0]?.id,
          spacing1: this.d1,
          instanceNum1: parseInt((this.l-2)/ this.d1) +1,
          direction1: this.dir,
          reverse1: 0}, "线性阵列4")
        await this.crownCADPlugin.command.execute()

        this.crownCADPlugin.command.clearCommand();

        let res9 = await this.crownCADPlugin.query.getEntitiesByFeatureNames(["拉伸曲面12"]);

        this.crownCADPlugin.command.solid.linearPattern({
          baseType: 0,
          body: res9.data.entities[0]?.id,
          spacing1: this.d1,
          instanceNum1: parseInt((this.l-2)/ this.d1) +1,
          direction1: this.dir,
          reverse1: 0}, "线性阵列5")
        await this.crownCADPlugin.command.execute()

        this.crownCADPlugin.command.clearCommand();
      },

      async createFuselagePillar1() {
        this.crownCADPlugin.command.sketch.createSketch({sketchName: '草图8', datumId: this.plane.id});
        let r= 0.5*this.d- this.d/27
        let angle1 = (this.c / 180) * Math.PI;
        let angle2 = (this.c1 / 180) * Math.PI;
        this.crownCADPlugin.command.sketch.createArcByCenter({
          centerPoint: new Point(0,0,0),
          startPoint: new Point(r* Math.cos(angle2), -1* r* Math.sin(angle2), 0),
          endPoint: new Point(r* Math.cos(angle1), -1* r* Math.sin(angle1), 0),
        })
        this.crownCADPlugin.command.sketch.createArcByCenter({
          centerPoint: new Point(0,0,0),
          startPoint: new Point(-1* r* Math.cos(angle1), -1* r* Math.sin(angle1), 0),
          endPoint: new Point(-1* r* Math.cos(angle2), -1* r* Math.sin(angle2), 0),
        })
        this.crownCADPlugin.command.sketch.createSketchLine({
          startPoint:  new Point(r* Math.cos(angle1), -1* r* Math.sin(angle1), 0),
          endPoint: new Point(-1* r* Math.cos(angle1), -1* r* Math.sin(angle1), 0)
        })

        this.crownCADPlugin.command.sketch.createSketchLine({
          startPoint:  new Point(r* Math.cos(angle2), -1* r* Math.sin(angle2), 0),
          endPoint: new Point(-1* r* Math.cos(angle2), -1* r* Math.sin(angle2), 0)
        })

        //退出草图
        this.crownCADPlugin.command.sketch.exitSketch();
        //实现草图操作，参数true会覆盖之前的草图，不传则不会
        await this.crownCADPlugin.command.execute()

        this.crownCADPlugin.command.clearCommand();

        this.crownCADPlugin.command.sketch.createSketch({sketchName: '草图9', datumId: this.plane.id});
        this.crownCADPlugin.command.sketch.createSketchLine({
          startPoint:  new Point(r* Math.cos(angle1), -1* r* Math.sin(angle1), 0),
          endPoint: new Point(-1* r* Math.cos(angle1), -1* r* Math.sin(angle1), 0)
        })

        //退出草图
        this.crownCADPlugin.command.sketch.exitSketch();
        //实现草图操作，参数true会覆盖之前的草图，不传则不会
        await this.crownCADPlugin.command.execute()

        this.crownCADPlugin.command.clearCommand();


        let res1 = await this.crownCADPlugin.query.getEntitiesByFeatureNames(["草图8"]);

        this.crownCADPlugin.command.surface.fillSurface({
          boundaryCurveIds: [ res1.data.entities[0]?.id]
        },'平面区域1')

        await this.crownCADPlugin.command.execute();

        this.crownCADPlugin.command.clearCommand();
        let res2 = await this.crownCADPlugin.query.getEntitiesByFeatureNames(["平面区域1"]);

        this.crownCADPlugin.command.solid.linearPattern({
          baseType: 0,
          body: res2.data.entities[0]?.id,
          spacing1: this.d1,
          instanceNum1: parseInt((this.l-2)/ this.d1) +1,
          direction1: this.dir,
          reverse1: 0}, "线性阵列6")
        await this.crownCADPlugin.command.execute();
        this.crownCADPlugin.command.clearCommand();

        let res3 = await this.crownCADPlugin.query.getElementsByFeatureNames(["线性阵列6"]);


        let planes= []
        res3.data.elements.forEach(element => {
          // 找到根据类型19找到所有的面，并储存到面faceIds数组，前两个面即为机翼的上面和下面
          if(element.type=== 19) {
            planes.push(element)
          }
        })

        let res4 = await this.crownCADPlugin.query.getEntitiesByFeatureNames(["草图9"]);

        this.crownCADPlugin.command.surface.extrudeSurface({
          curveIds: [res4.data.entities[0].id],
          extrudeType1: 1,
          // height1: this.l,
          toSurface1: planes[planes.length-1].id,
          draftType1: -1,
          reverse: 1
          // extrudeType2: 1,
          // height2: 10,
          // toSurface2: this.faceIds[0].id,
          // draftType2: -1,
        },'拉伸曲面13')
        await this.crownCADPlugin.command.execute();
        this.crownCADPlugin.command.clearCommand();

        let angle3 = (this.e/ 180) * Math.PI;
        this.crownCADPlugin.command.sketch.createSketch({sketchName: '草图10', datumId: this.plane.id});
        this.crownCADPlugin.command.sketch.createSketchLine({
          startPoint:  new Point( r* Math.sin(angle2)/ Math.tan(angle3),  r* Math.sin(angle2)*-1, 0),
          endPoint: new Point(r* Math.cos(angle3),  r* Math.sin(angle3)*-1, 0)
        })

        //退出草图
        this.crownCADPlugin.command.sketch.exitSketch();
        //实现草图操作，参数true会覆盖之前的草图，不传则不会
        await this.crownCADPlugin.command.execute()

        this.crownCADPlugin.command.clearCommand();

        this.crownCADPlugin.command.sketch.createSketch({sketchName: '草图11', datumId: this.plane.id});
        this.crownCADPlugin.command.sketch.createSketchLine({
          startPoint:  new Point(-1*r* Math.sin(angle2)/ Math.tan(angle3),  r* Math.sin(angle2)*-1, 0),
          endPoint: new Point(r* Math.cos(angle3)*-1,  r* Math.sin(angle3)*-1, 0)
        })

        //退出草图
        this.crownCADPlugin.command.sketch.exitSketch();
        //实现草图操作，参数true会覆盖之前的草图，不传则不会
        await this.crownCADPlugin.command.execute()

        this.crownCADPlugin.command.clearCommand();


        let res6 = await this.crownCADPlugin.query.getEntitiesByFeatureNames(["草图10"]);


        this.crownCADPlugin.command.surface.extrudeSurface({
          curveIds: [res6.data.entities[0].id],
          extrudeType1: 0,
          height1: 1,
          draftType1: -1,
          reverse: 1,
          // extrudeType2: 0,
          // height2: 0.5,
          // draftType2: -1,
        },'拉伸曲面14')
        await this.crownCADPlugin.command.execute()

        this.crownCADPlugin.command.clearCommand();
        let res7 = await this.crownCADPlugin.query.getEntitiesByFeatureNames(["草图11"]);


        this.crownCADPlugin.command.surface.extrudeSurface({
          curveIds: [res7.data.entities[0].id],
          extrudeType1: 0,
          height1: 1,
          draftType1: -1,
          reverse: 1,
          // extrudeType2: 0,
          // height2: 0.5,
          // draftType2: -1,
        },'拉伸曲面15')
        await this.crownCADPlugin.command.execute()

        this.crownCADPlugin.command.clearCommand();

        let res8 = await this.crownCADPlugin.query.getEntitiesByFeatureNames(["拉伸曲面14"]);

        this.crownCADPlugin.command.solid.linearPattern({
          baseType: 0,
          body: res8.data.entities[0]?.id,
          spacing1: this.d1,
          instanceNum1: parseInt((this.l-2)/ this.d1) +1,
          direction1: this.dir,
          reverse1: 0}, "线性阵列7")
        await this.crownCADPlugin.command.execute()

        this.crownCADPlugin.command.clearCommand();

        let res9 = await this.crownCADPlugin.query.getEntitiesByFeatureNames(["拉伸曲面15"]);

        this.crownCADPlugin.command.solid.linearPattern({
          baseType: 0,
          body: res9.data.entities[0]?.id,
          spacing1: this.d1,
          instanceNum1: parseInt((this.l-2)/ this.d1) +1,
          direction1: this.dir,
          reverse1: 0}, "线性阵列8")
        await this.crownCADPlugin.command.execute()

        this.crownCADPlugin.command.clearCommand();

      }

    }
  }
</script>

<style scoped>
  >>> .el-form-item {
    margin-bottom: 0!important;
  }

  >>> .el-form-item__label {
    margin-bottom: 0!important;
  }
</style>
